package com.kedou.sdk.params;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;
import com.kedou.sdk.utils.XmlUtils;

public class BaseRequestParams extends RequestDataParams implements Parcelable {


    public BaseRequestParams(){

    }
    /**
     * 公会渠道ID
     */
    @SerializedName("channel_id")
    private String channelId;
    @Override
    public String getServiceString() {
        return null;
    }
    /**
     * 游戏ID
     */
    @SerializedName("game_id")
    private String gameId;
    /***
     * SDK版本号，默认3.0.0版本
     */
    @SerializedName("sdk_version")
    private String sdk_version = "1.1";
    @SerializedName("timestamp")
    private String timestamp ;
    @SerializedName("noncestr")
    private String noncestr ;
    @SerializedName("device_id")
    private String deviceId ;
//    @SerializedName("mac")
//    private String mac ;
//    @SerializedName("model")
//    private String model ;
    @SerializedName("is_simulator")
    private int isSimulator ;

    @SerializedName("platform")
    private String platform ="android";
    @SerializedName("device_code")
    private String deviceCode;



//    @SerializedName("device_oaid")
//    private String oaid ;

//    @SerializedName("sign")
//    private String sign ;

    public static final Creator<BaseRequestParams> CREATOR = new Creator<BaseRequestParams>() {
        @Override
        public BaseRequestParams createFromParcel(Parcel in) {
            return new BaseRequestParams(in);
        }

        @Override
        public BaseRequestParams[] newArray(int size) {
            return new BaseRequestParams[size];
        }
    };

    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    public String getGameId() {
        return gameId;
    }

    public void setGameId(String gameId) {
        this.gameId = gameId;
    }

    public String getSdk_version() {
        return sdk_version;
    }

    public void setSdk_version(String sdk_version) {
        this.sdk_version = sdk_version;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }
//
    public String getNoncestr() {
        return noncestr;
    }

    public void setNoncestr(String noncestr) {
        this.noncestr = noncestr;
    }
//
//    public String getSign() {
//        return sign;
//    }
//
//    public void setSign(String sign) {
//        this.sign = sign;
//    }

//    public String getOaid() {
//        return oaid;
//    }
//
//    public void setOaid(String oaid) {
//        this.oaid = oaid;
//    }

    public String getDeviceCode() {
        return deviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
//
//    public String getMac() {
//        return mac;
//    }
//
//    public void setMac(String mac) {
//        this.mac = mac;
//    }
//
//    public String getModel() {
//        return model;
//    }
//
//    public void setModel(String model) {
//        this.model = model;
//    }

    public int getIsSimulator() {
        return isSimulator;
    }

    public void setIsSimulator(int isSimulator) {
        this.isSimulator = isSimulator;
    }

    public String getPlatform() {
        return platform;
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.channelId);
        dest.writeString(this.gameId);
        dest.writeString(this.sdk_version);
        dest.writeString(this.timestamp);
        dest.writeString(this.noncestr);
        dest.writeString(this.deviceId);
//        dest.writeString(this.mac);
//        dest.writeString(this.model);
        dest.writeInt(this.isSimulator);
        dest.writeString(this.platform);
//        dest.writeString(this.oaid);
//        dest.writeString(this.sign);
        dest.writeString(this.deviceCode);
    }

    protected BaseRequestParams(Parcel in) {
        this.channelId = in.readString();
        this.gameId = in.readString();
        this.sdk_version = in.readString();
        this.timestamp = in.readString();
        this.noncestr = in.readString();
        this.deviceId = in.readString();
//        this.mac =in.readString();
//        this.model = in.readString();
        this.isSimulator = in.readInt();
        this.platform = in.readString();
//        this.oaid = in.readString();
//        this.sign = in.readString();
        this.deviceCode = in.readString();

    }
    public String getPostUrl(){
        return XmlUtils.getPlatformPostUrl()+getServiceString();
    }
}
